RECORDS = [
        {
            "studentNo": 1,
            "name": "嬴政",
            "age": 52,
            "sex": "男",
            "class": "2班",
            "card": "1000200030004000",
            "city": "上海"
        },
        {
            "studentNo": 2,
            "name": "韩非子",
            "age": 29,
            "sex": "女",
            "class": "3班",
            "card": "1000200030003000",
            "city": "天津"
        },
        {
            "studentNo": 3,
            "name": "王剪",
            "age": 27,
            "sex": "女",
            "class": "4班",
            "card": "1000200030002000",
            "city": "河南"
        },
        {
            "studentNo": 4,
            "name": "刘邦",
            "age": 53,
            "sex": "男",
            "class": "5班",
            "card": "1000200030004000",
            "city": "北京"
        },
        {
            "studentNo": 5,
            "name": "韩信",
            "age": 32,
            "sex": "男",
            "class": "1班",
            "card": None,
            "city": "河北"
        },
        {
            "studentNo": 6,
            "name": "项宇",
            "age": 30,
            "sex": "女",
            "class": "5班",
            "card": "1000200030005000",
            "city": "天津"
        },
        {
            "studentNo": 7,
            "name": "李红广",
            "age": 40,
            "sex": "男",
            "class": "5班",
            "card": "1000200030008000",
            "city": "上海"
        },
        {
            "studentNo": 8,
            "name": "刘彻",
            "age": 39,
            "sex": "男",
            "class": "2班",
            "card": "1000200030007000",
            "city": "广州"
        },
        {
            "studentNo": 9,
            "name": "韩王",
            "age": 28,
            "sex": "女",
            "class": "6班",
            "card": None,
            "city": "上海"
        },
        {
            "studentNo": 10,
            "name": "韩大夫",
            "age": 21,
            "sex": "女",
            "class": "7班",
            "card": "1000200030009000",
            "city": "山东"
        },
        {
            "studentNo": 11,
            "name": "霍去病",
            "age": 29,
            "sex": "男",
            "class": "8班",
            "card": "1000200020004000",
            "city": "广州"
        },
        {
            "studentNo": 12,
            "name": "萧何",
            "age": 36,
            "sex": "男",
            "class": "3班",
            "card": "1000200030006000",
            "city": "上海"
        },
        {
            "studentNo": 13,
            "name": "卫青",
            "age": 37,
            "sex": "女",
            "class": "8班",
            "card": "1000200060004000",
            "city": "重庆"
        },
        {
            "studentNo": 14,
            "name": "曹总",
            "age": 26,
            "sex": "女",
            "class": "3班",
            "card": "1000200080004000",
            "city": "四川"
        },
        {
            "studentNo": 15,
            "name": "王韩亮",
            "age": 56,
            "sex": "女",
            "class": "2班",
            "card": None,
            "city": "云南"
        },
        {
            "studentNo": 16,
            "name": "刘备",
            "age": 51,
            "sex": "男",
            "class": "5班",
            "card": "1000100030004000",
            "city": "北京"
        },
        {
            "studentNo": 17,
            "name": "薛刚",
            "age": 28,
            "sex": "男",
            "class": "4班",
            "card": "1000100030005000",
            "city": "河南"
        },
        {
            "studentNo": 18,
            "name": "柳红",
            "age": 20,
            "sex": "男",
            "class": "4班",
            "card": "1000100030005000",
            "city": "广州"
        },
        {
            "studentNo": 19,
            "name": "陈胜",
            "age": 25,
            "sex": "男",
            "class": "1班",
            "card": "1000100030006000",
            "city": "北京"
        },
        {
            "studentNo": 20,
            "name": "刘韩",
            "age": 29,
            "sex": "男",
            "class": "1班",
            "card": "1000100030007000",
            "city": "上海"
        },
        {
            "studentNo": 21,
            "name": "霍去病",
            "age": 40,
            "sex": "男",
            "class": "2班",
            "card": "1000200030005010",
            "city": "海南"
        },
        {
            "studentNo": 22,
            "name": "项宇",
            "age": 20,
            "sex": "女",
            "class": "2班",
            "card": "1000200030006000",
            "city": "天津"
        },
        {
            "studentNo": 23,
            "name": "八戒",
            "age": 25,
            "sex": "男",
            "class": "2班",
            "card": "100085",
            "city": "上海"
        },
        {
            "studentNo": 24,
            "name": "韩正",
            "age": 35,
            "sex": "男",
            "class": "3班",
            "card": "1000200030005011",
            "city": "哈尔滨"
        },
        {
            "studentNo": 25,
            "name": "孙悟空",
            "age": 39,
            "sex": "男",
            "class": "6班",
            "card": "1010102323343",
            "city": "北京"
        }
    ]
if __name__ == '__main__':

    result1 = {'code': 0, 'message': '登录成功！'}
    result2 = {'code': 1, 'message': '用户名不能为空，登录失败！'}
    result3 = {'code': 2, 'message': '密码不能为空，登录失败！'}
    result4 = {'code': 3, 'message': '用户名或密码错误，登录失败！'}
    result5 = {'code': 4, 'message': '还未登录，请先登录！'}
    result6 = {'code': 5, 'message': '你选择了放弃登录，期待下次再见！'}
    result7 = {'code': 6, 'message': '退出登录成功，再见！'}
    result8 = {'code': 7, 'message': '查询越界，请核实！'}
    result9 = {'code': 8, 'message': '查询到结果！'}
    result10 = {'code': 9, 'message': '未查询到结果！'}
    result11 = {'code': 10, 'message': '由于必填项未填全，保存失败！'}
    result12 = {'code': 11, 'message': '已保存更改，学生信息增加成功！'}
    result13 = {'code': 12, 'message': '学号不能为空，请重新输入！'}
    result14 = {'code': 13, 'message': '学号有误，请核实后输入！'}
    result15 = {'code': 14, 'message': '学号已存在，请核实后输入！'}
    result16 = {'code': 15, 'message': '学号添加成功！'}
    result17 = {'code': 16, 'message': '姓名不能为空，请重新输入！'}
    result18 = {'code': 17, 'message': '姓名有误，请核实后输入！'}
    result19 = {'code': 18, 'message': '姓名长度超出限定值，请核实后输入！'}
    result20 = {'code': 19, 'message': '姓名添加成功！'}
    result21 = {'code': 20, 'message': '年龄输入有误，已恢复为默认值！'}
    result22 = {'code': 21, 'message': '年龄大小超出限定值，已恢复为默认值！'}
    result23 = {'code': 22, 'message': '年龄添加成功！'}
    result24 = {'code': 23, 'message': '性别输入有误，已恢复为默认值！'}
    result25 = {'code': 24, 'message': '性别添加成功！'}
    result26 = {'code': 25, 'message': '班号输入有误，已恢复为默认值！'}
    result27 = {'code': 26, 'message': '班号大小超出限定值，已恢复为默认值！'}
    result28 = {'code': 27, 'message': '班级添加成功！'}
    result29 = {'code': 28, 'message': '卡号输入有误，已恢复为默认值！'}
    result30 = {'code': 29, 'message': '卡号位数超出限定值，已恢复为默认值！'}
    result31 = {'code': 30, 'message': '卡号已存在，添加失败，已恢复为默认值！'}
    result32 = {'code': 31, 'message': '卡号添加成功！'}
    result33 = {'code': 32, 'message': '家乡输入有误，已恢复为默认值！'}
    result34 = {'code': 33, 'message': '家乡添加成功！'}
    result35 = {'code': 34, 'message': '学号不存在，请核实后输入！'}
    result36 = {'code': 35, 'message': '姓名有误，已恢复为原值！'}
    result37 = {'code': 36, 'message': '姓名长度超出限定值，已恢复为原值！'}
    result38 = {'code': 37, 'message': '学号有误，已恢复为原值！'}
    result39 = {'code': 38, 'message': '学号不得重复，已恢复为原值！'}
    result40 = {'code': 39, 'message': '学号修改成功！'}
    result41 = {'code': 40, 'message': '已保存最近修改！'}
    result42 = {'code': 41, 'message': '姓名修改成功！'}
    result43 = {'code': 42, 'message': '年龄有误，已恢复为原值！'}
    result44 = {'code': 43, 'message': '年龄大小超出限定值，已恢复为原值！'}
    result45 = {'code': 44, 'message': '年龄修改成功！'}
    result46 = {'code': 45, 'message': '性别输入有误，已恢复为原值！'}
    result47 = {'code': 46, 'message': '性别修改成功！'}
    result48 = {'code': 47, 'message': '班号输入有误，已恢复为原值！'}
    result49 = {'code': 48, 'message': '班号大小超出限定值，已恢复为原值！'}
    result50 = {'code': 49, 'message': '班级修改成功！'}
    result51 = {'code': 50, 'message': '卡号输入有误，已恢复为原值！'}
    result52 = {'code': 51, 'message': '卡号不得重复，已恢复为原值！'}
    result53 = {'code': 52, 'message': '卡号修改成功！'}
    result54 = {'code': 53, 'message': '家乡输入有误，已恢复为原值！'}
    result55 = {'code': 54, 'message': '家乡修改成功！'}
    result56 = {'code': 55, 'message': '没找到对象，删除失败！'}
    result57 = {'code': 56, 'message': '删除成功！'}


    def login_func(name, pwd):
        if name == '' or name.isspace():
            return result2
        elif pwd == '' or pwd.isspace():
            return result3
        elif name == 'admin' and pwd == '123456':
            return result1
        else:
            return result4


    def add_opt1():
        add_kw = input('请输入具体信息：')
        lst1 = []
        for a in RECORDS:
            lst1.append(a.get('studentNo'))
        if add_kw == '' or add_kw.isspace():
            return result13, None
        elif not add_kw.isdigit() or (add_kw.isdigit() and int(add_kw) == 0):
            return result14, None
        elif int(add_kw) in lst1:
            return result15, None
        else:
            return result16, int(add_kw)


    def add_opt2():
        add_kw = input('请输入具体信息：')
        if add_kw == '' or add_kw.isspace():
            return result17, None
        elif add_kw.isdigit():
            return result18, None
        elif len(add_kw) > 30:
            return result19, None
        else:
            return result20, add_kw


    def add_opt3(studentNo, name):
        dic3 = {"studentNo": studentNo, "name": name, "age": "保密", "sex": "保密", "class": "保密", "card": "保密", "city": "保密"}
        RECORDS.append(dic3)


    def add_opt41():
        add_kw = input('请输入具体信息：')
        if not add_kw.isdigit() or (add_kw.isdigit() and int(add_kw) == 0):
            ult_dic.update({"age": "保密"})
            return result21
        elif int(add_kw) > 250:
            ult_dic.update({"age": "保密"})
            return result22
        else:
            ult_dic.update({"age": int(add_kw)})
            return result23


    def add_opt42():
        add_kw = input('请输入具体信息：')
        if  add_kw not in ("男", "女"):
            ult_dic.update({"sex": '保密'})
            return result24
        else:
            ult_dic.update({"sex": add_kw})
            return result25


    def add_opt43():
        add_kw = input('请输入班号：')
        if not add_kw.isdigit() or (add_kw.isdigit() and int(add_kw) == 0):
            ult_dic.update({"class": "保密"})
            return result26
        elif int(add_kw) > 13:
            ult_dic.update({"class": "保密"})
            return result27
        else:
            ult_dic.update({"class": add_kw + '班'})
            return result28


    def add_opt44():
        add_kw = input('请输入具体信息：')
        lst1 = []
        for a in RECORDS:
            lst1.append(a.get("card"))
        if not add_kw.isdigit() or (add_kw.isdigit() and int(add_kw) == 0):
            ult_dic.update({"card": "保密"})
            return result29
        elif len(add_kw) < 16 or len(add_kw) > 21:
            ult_dic.update({"card": "保密"})
            return result30
        elif add_kw in lst1:
            ult_dic.update({"card": "保密"})
            return result31
        else:
            ult_dic.update({"card": add_kw})
            return result32


    def add_opt45():
        add_kw = input('请输入具体信息：')
        if not add_kw.isalnum():
            ult_dic.update({"city": "保密"})
            return result33
        elif add_kw.isdigit():
            ult_dic.update({"city": "保密"})
            return result33
        else:
            ult_dic.update({"city": add_kw})
            return result34


    def mod_opt1(mod_opt_dt, obj_index, **obj_entity):
        if mod_opt_dt == '1':
            sno = obj_entity.get('obj_entity').get('studentNo')
            mod_kw = input(f'学号原值为{sno}，修改为：')
            lst1 = []
            for a in RECORDS:
                lst1.append(a.get('studentNo'))
            if not mod_kw.isdigit() or (mod_kw.isdigit() and int(mod_kw) == 0):
                return result38, obj_entity
            elif int(mod_kw) in lst1 and int(mod_kw) != sno:
                return result39, obj_entity
            else:
                obj_entity.get('obj_entity').update({"studentNo":int(mod_kw)})
                RECORDS[obj_index].update({"studentNo":int(mod_kw)})
                return result40, obj_entity
        elif mod_opt_dt == '2':
            nm = obj_entity.get('obj_entity').get('name')
            mod_kw = input(f'姓名原值为{nm}，修改为：')
            if mod_kw == '' or mod_kw.isspace() or mod_kw.isdigit():
                return result36, obj_entity
            elif len(mod_kw) > 30:
                return result37, obj_entity
            else:
                obj_entity.get('obj_entity').update({"name": mod_kw})
                RECORDS[obj_index].update({"name": mod_kw})
                return result42, obj_entity
        elif mod_opt_dt == '3':
            ag = obj_entity.get('obj_entity').get('age')
            mod_kw = input(f'年龄原值为{ag}，修改为：')
            if (not mod_kw.isdigit() and mod_kw != '保密') or (mod_kw.isdigit() and int(mod_kw) == 0):
                return result43, obj_entity
            elif mod_kw != '保密' and int(mod_kw) > 250:
                return result44, obj_entity
            elif mod_kw != '保密':
                obj_entity.get('obj_entity').update({"age": int(mod_kw)})
                RECORDS[obj_index].update({"age": int(mod_kw)})
                return result45, obj_entity
            else:
                obj_entity.get('obj_entity').update({"age": mod_kw})
                RECORDS[obj_index].update({"age": mod_kw})
                return result45, obj_entity
        elif mod_opt_dt == '4':
            sx = obj_entity.get('obj_entity').get('sex')
            mod_kw = input(f'性别原值为{sx}，修改为：')
            if mod_kw not in ("男", "女", '保密'):
                return result46, obj_entity
            else:
                obj_entity.get('obj_entity').update({"sex": mod_kw})
                RECORDS[obj_index].update({"sex": mod_kw})
                return result47, obj_entity
        elif mod_opt_dt == '5':
            cls = obj_entity.get('obj_entity').get('class')
            mod_kw = input(f'班级原值为{cls}，"班号"修改为(请输入正整数)：')
            if (not mod_kw.isdigit() and mod_kw != '保密') or (mod_kw.isdigit() and int(mod_kw) == 0):
                return result48, obj_entity
            elif mod_kw != '保密' and int(mod_kw) > 13:
                return result49, obj_entity
            elif mod_kw != '保密':
                obj_entity.get('obj_entity').update({"class": mod_kw + '班'})
                RECORDS[obj_index].update({"class": mod_kw + '班'})
                return result50, obj_entity
            else:
                obj_entity.get('obj_entity').update({"class": mod_kw})
                RECORDS[obj_index].update({"class": mod_kw})
                return result50, obj_entity
        elif mod_opt_dt == '6':
            crd = obj_entity.get('obj_entity').get('card')
            mod_kw = input(f'卡号原值为{crd}，修改为：')
            lst1 = []
            for a in RECORDS:
                lst1.append(a.get('card'))
            if (not mod_kw.isdigit() and mod_kw != '保密') or (mod_kw.isdigit() and int(mod_kw) == 0):
                return result51, obj_entity
            elif mod_kw != '保密' and (len(mod_kw) < 16 or len(mod_kw) > 21):
                return result51, obj_entity
            elif mod_kw != '保密' and mod_kw in lst1 and mod_kw != crd:
                return result52, obj_entity
            else:
                obj_entity.get('obj_entity').update({"card": mod_kw})
                RECORDS[obj_index].update({"card": mod_kw})
                return result53, obj_entity
        else:
            ct = obj_entity.get('obj_entity').get('city')
            mod_kw = input(f'家乡原值为{ct}，修改为：')
            if not mod_kw.isalnum():
                return result54, obj_entity
            elif mod_kw.isdigit():
                return result54, obj_entity
            else:
                obj_entity.get('obj_entity').update({"city": mod_kw})
                RECORDS[obj_index].update({"city": mod_kw})
                return result55, obj_entity


    class Table_Students:
        is_login = 0

        def add_student(self, add_opt):
            if add_opt == '1':
                return add_opt1()
            elif add_opt == '2':
                return add_opt2()
            elif add_opt == '4.1':
                return add_opt41()
            elif add_opt == '4.2':
                return add_opt42()
            elif add_opt == '4.3':
                return add_opt43()
            elif add_opt == '4.4':
                return add_opt44()
            else:
                return add_opt45()

        def del_student(self, del_opt):
            del_kw = input('请输入具体信息：')
            if del_kw == '' or del_kw.isspace():
                return result56
            if del_opt == '1' and del_kw.isdigit():
                lst1 = []
                for b in RECORDS:
                    if int(del_kw) == b.get('studentNo'):
                        lst1.append(b)
                if not len(lst1):
                    return result56
                else:
                    for obj_del in lst1:
                        RECORDS.remove(obj_del)
                    return result57, f'被删除的信息有：{lst1}'
            if del_opt == '1' and not del_kw.isdigit():
                return result56
            if del_opt == '2':
                lst2 = []
                for b in RECORDS:
                    if del_kw == b.get('name'):
                        lst2.append(b)
                if not len(lst2):
                    return result56
                else:
                    for obj_del in lst2:
                        RECORDS.remove(obj_del)
                    return result57, f'被删除的信息有：{lst2}'
            if del_opt == '3' and del_kw.isdigit():
                lst2 = []
                for b in RECORDS:
                    if int(del_kw) == b.get('age'):
                        lst2.append(b)
                if not len(lst2):
                    return result56
                else:
                    for obj_del in lst2:
                        RECORDS.remove(obj_del)
                    return result57, f'被删除的信息有：{lst2}'
            if del_opt == '3' and not del_kw.isdigit():
                return result56
            if del_opt == '4':
                lst2 = []
                for b in RECORDS:
                    if del_kw == b.get('sex'):
                        lst2.append(b)
                if not len(lst2):
                    return result56
                else:
                    for obj_del in lst2:
                        RECORDS.remove(obj_del)
                    return result57, f'被删除的信息有：{lst2}'
            if del_opt == '5':
                lst2 = []
                for b in RECORDS:
                    if del_kw in b.get('class'):
                        lst2.append(b)
                if not len(lst2):
                    return result56
                else:
                    for obj_del in lst2:
                        RECORDS.remove(obj_del)
                    return result57, f'被删除的信息有：{lst2}'
            if del_opt == '6':
                lst2 = []
                for b in RECORDS:
                    if del_kw == b.get('card'):
                        lst2.append(b)
                if not len(lst2):
                    return result56
                else:
                    for obj_del in lst2:
                        RECORDS.remove(obj_del)
                    return result57, f'被删除的信息有：{lst2}'
            if del_opt == '7':
                lst2 = []
                for b in RECORDS:
                    if del_kw == b.get('city'):
                        lst2.append(b)
                if not len(lst2):
                    return result56
                else:
                    for obj_del in lst2:
                        RECORDS.remove(obj_del)
                    return result57, f'被删除的信息有：{lst2}'


        def mod_student(self):
            mod_kw = input('请输入具体信息：')
            if not mod_kw.isdigit() or (mod_kw.isdigit() and int(mod_kw) == 0):
                    return result14, None
            lst1 = []
            for a in RECORDS:
                lst1.append(a.get('studentNo'))
                if int(mod_kw) == a.get('studentNo'):
                    obj_index = RECORDS.index(a)
                    obj_entity = a
                    break
            if int(mod_kw) not in lst1:
                return result35, None
            print('成功定位到学生！\n')
            print(f'这位学生的当前信息为：{obj_entity}\n')
            while 1:
                mod_opt_dt = input('1.学号\n'
                                '2.姓名\n'
                                '3.年龄\n'
                                '4.性别\n'
                                '5.班级\n'
                                '6.卡号\n'
                                '7.家乡\n'
                                '8.保存并返回主菜单\n'
                                '9.保存并修改下一位学生的信息\n'
                                '请选择您想修改的信息或其他操作（输入字段前面的数字即可）：\n')
                if mod_opt_dt not in ('1', '2', '3', '4', '5', '7', '6', '8', '9') or mod_opt_dt == '':
                    print('输入有误！请重新输入!\n')
                else:
                    if mod_opt_dt != '8' and mod_opt_dt != '9':
                        container = mod_opt1(mod_opt_dt, obj_index, obj_entity=obj_entity)
                        obj_entity.update(container[1].get("obj_entity"))
                        print(container[0])
                    elif mod_opt_dt == '8':
                        return result41, not None
                    else:
                        return result41, None


        def sea_student(self, sea_opt):
            sea_kw = input('请输入查询关键字：')
            if sea_kw == '' or sea_kw.isspace():
                return RECORDS
            elif sea_opt == '1' and sea_kw.isdigit():
                lst1, lst2 = [], []
                for a in RECORDS:
                    lst1.append(a.get('studentNo'))
                if int(sea_kw) < min(tuple(lst1)) or int(sea_kw) > max(tuple(lst1)):
                    return result8
                else:
                    for b in RECORDS:
                        if int(sea_kw) == b.get('studentNo'):
                            lst2.append(b)
                    if not len(lst2):
                        return result10
                    else:
                        return result9, lst2
            elif sea_opt == '1' and not sea_kw.isdigit():
                return result10
            elif sea_opt == '2':
                lst2 = []
                for b in RECORDS:
                    if sea_kw in b.get('name'):
                        lst2.append(b)
                if not len(lst2):
                    return result10
                else:
                    return result9, lst2
            elif sea_opt == '3' and sea_kw.isdigit():
                lst1, lst2 = [], []
                for a in RECORDS:
                    lst1.append(a.get('age'))
                if int(sea_kw) < min(tuple(lst1)) or int(sea_kw) > max(tuple(lst1)):
                    return result8
                else:
                    for b in RECORDS:
                        if int(sea_kw) == b.get('age'):
                            lst2.append(b)
                    if not len(lst2):
                        return result10
                    else:
                        return result9, lst2
            elif sea_opt == '3' and not sea_kw.isdigit():
                return result10
            elif sea_opt == '4':
                lst2 = []
                for b in RECORDS:
                    if sea_kw == b.get('sex'):
                        lst2.append(b)
                if not len(lst2):
                    return result10
                else:
                    return result9, lst2
            elif sea_opt == '5':
                lst2 = []
                for b in RECORDS:
                    if sea_kw in b.get('class'):
                        lst2.append(b)
                if not len(lst2):
                    return result10
                else:
                    return result9, lst2
            elif sea_opt == '6':
                lst2 = []
                for b in RECORDS:
                    if sea_kw == b.get('card'):
                        lst2.append(b)
                if not len(lst2):
                    return result10
                else:
                    return result9, lst2
            elif sea_opt == '7':
                lst2 = []
                for b in RECORDS:
                    if sea_kw in b.get('city'):
                        lst2.append(b)
                if not len(lst2):
                    return result10
                else:
                    return result9, lst2

        def __init__(self):
            if Table_Students.is_login == 0:
                print(result5)
                flag = True
                while flag:
                    name = input('请输入用户名（若不想进行登录，请在此处输入 stop）：\n')
                    if name == 'stop':
                        print(result6)
                        break
                    pwd = input('请输入密码（若不想进行登录，请在此处输入 stop）：\n')
                    if pwd == 'stop':
                        print(result6)
                        break
                    print(login_func(name, pwd))
                    if not login_func(name, pwd).get('code'):
                        flag = False
                        Table_Students.is_login = 1
                        while not flag:
                            opt = input('1.增加学生信息\n'
                            '2.删除学生信息\n'
                            '3.修改学生信息\n'
                            '4.查询学生信息\n'
                            '5.退出当前登录\n'
                            '请做出您的选择（输入您想进行的操作前面的数字即可）：\n')
                            if opt == '1':
                                lst1 = []
                                while not flag:
                                    back_home = 0
                                    add_opt1 = input(
                                    '1.学号（必填项）\n'
                                    '2.姓名（必填项）\n'
                                    '3.保存并返回主菜单\n'
                                    '4.继续添加其它信息\n'
                                    '请选择您想增添的信息或其他操作（输入字段前面的数字即可）：\n')
                                    if add_opt1 not in ('1', '2', '3', '4') or add_opt1 == '':
                                        print('输入有误！请重新输入!\n')
                                    else:
                                        lst1.append(add_opt1)
                                        if add_opt1 == '3' and not ('1' in lst1 and '2' in lst1):
                                            print(result11)
                                            break
                                        elif add_opt1 == '4' and not ('1' in lst1 and '2' in lst1):
                                            print('请先填全必填项！')
                                        elif add_opt1 == '2' or add_opt1 == '1':
                                            container = self.add_student(add_opt1)
                                            if add_opt1 == '2':
                                                y = container[1]
                                            else:
                                                x = container[1]
                                            print(container[0])
                                        elif add_opt1 == '3' and ('1' in lst1 and '2' in lst1):
                                            if x == None or y == None:
                                                print(result11)
                                                break
                                            else:
                                                print(result12)
                                                add_opt3(x, y)
                                                break
                                        elif add_opt1 == '4' and ('1' in lst1 and '2' in lst1):
                                            if x == None or y == None:
                                                print('请先填全必填项！')
                                            else:
                                                global ult_dic
                                                ult_dic = {'studentNo': x, 'name': y, 'age': '保密', 'sex': '保密', 'class': '保密', 'card': '保密', 'city': '保密'}
                                                while not flag:
                                                    add_opt2 = input(f'注意：若输入4.1~4.5，默认对象是学号为{x}号的学生！\n'
                                                    '4.1 年龄\n'
                                                    '4.2 性别\n'
                                                    '4.3 班级\n'
                                                    '4.4 卡号\n'
                                                    '4.5 家乡\n'
                                                    '5 保存并返回主菜单\n'
                                                    '6 保存并新增一位学生信息\n'
                                                    '请选择您想增添的信息或其他操作（输入字段前面的数字即可）：\n')
                                                    if add_opt2 not in ('4.1', '4.2', '4.3', '4.4', '4.5', '5', '6') or add_opt2 == '':
                                                        print('输入有误！请重新输入!\n')
                                                    else:
                                                        if add_opt2 != '5' and add_opt2 != '6':
                                                            print(self.add_student(add_opt2))
                                                        else:
                                                            print(result12)
                                                            if add_opt2 == '5':
                                                                back_home += 1
                                                            else:
                                                                lst1 = []
                                                            RECORDS.append(ult_dic)
                                                            break
                                                if back_home != 0:
                                                    break
                            elif opt == '2':
                                while not flag:
                                    del_opt = input(
                                    '1.学号(建议项)\n'
                                    '2.姓名\n'
                                    '3.年龄\n'
                                    '4.性别\n'
                                    '5.班级\n'
                                    '6.卡号\n'
                                    '7.家乡\n'
                                    '8.返回主菜单\n'
                                    '注意：删除操作是不可逆的，且不会再次确认！！！\n'
                                    '请选择您想删除的条件或返回主菜单（输入字段前面的数字即可）：\n')
                                    if del_opt not in ('1', '2', '3', '4', '5', '6', '7', '8') or del_opt == '':
                                        print('输入有误！请重新输入!\n')
                                    elif del_opt == '8':
                                        break
                                    else:
                                        fhz = self.del_student(del_opt)
                                        if type(fhz) is tuple:
                                            for fhzz in fhz:
                                                print(fhzz)
                                        else:
                                            print(fhz)
                            elif opt == '3':
                                while not flag:
                                    mod_opt = input(
                                        '1.学号\n'
                                        '2.返回主菜单\n'
                                        '请选择定位修改对象的信息或其他操作（输入字段前面的数字即可）：\n')
                                    if mod_opt not in ('1', '2') or mod_opt == '':
                                        print('输入有误！请重新输入!\n')
                                    else:
                                        if mod_opt == '2':
                                            break
                                        else:
                                            ano_container = self.mod_student()
                                            print(ano_container[0])
                                            if ano_container[1] != None:
                                                break
                            elif opt == '4':
                                while not flag:
                                    sea_opt = input(
                                    '1.学号\n'
                                    '2.姓名\n'
                                    '3.年龄\n'
                                    '4.性别\n'
                                    '5.班级\n'
                                    '6.卡号\n'
                                    '7.家乡\n'
                                    '8.返回主菜单\n'
                                    '请选择您想查询的条件或返回主菜单（输入字段前面的数字即可）：\n')
                                    if sea_opt not in ('1', '2', '3', '4', '5', '6', '7', '8') or sea_opt == '':
                                        print('输入有误！请重新输入!\n')
                                    elif sea_opt == '8':
                                        break
                                    else:
                                        fhz = self.sea_student(sea_opt)
                                        if type(fhz) is tuple:
                                            for fhzz in fhz:
                                                print(fhzz)
                                        else:
                                            print(fhz)
                            elif opt == '5':
                                Table_Students.is_login -= 1
                                print(result7)
                                break
                            else:
                                print('输入有误！请重新输入!\n')


    xm = Table_Students()
    xh = Table_Students()
